package src.com.itheima.entry;



import src.com.itheima.operator.StudentOperator;

import java.util.Scanner;

/**
 * 系统入口
 */
public class SystemEntry {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StudentOperator studentOperator = new StudentOperator();
        //死循环
        while (true){
            System.out.println("欢迎来到学生管理系统");
            System.out.println("1.添加学生");
            System.out.println("2.删除学生");
            System.out.println("3.修改学生");
            System.out.println("4.查看学生");
            System.out.println("5.退出系统");
            //键盘录入
            String s = sc.nextLine();
            //switch
            switch (s) {
                case "1":
                   studentOperator.add();
                   break;
                case "2":
                    studentOperator.delete();
                    break;
                case "3":
                    studentOperator.update();
                    break;
                case "4":
                    studentOperator.findAll();
                    break;
                case "5":
                    System.exit(0);
                default:
                    System.out.println("输入有误");
                    break;
            }
        }
    }
}
